package com.androidian.tippit;


import com.androidian.tippit.fragments.FragmentBillTotal;
import com.androidian.tippit.fragments.FragmentPeopleNumber;
import com.androidian.tippit.fragments.FragmentTipPercentage;
import com.androidian.tippit.fragments.FragmentTotals;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class HomePagerAdapter extends FragmentPagerAdapter 
{

	
	public HomePagerAdapter(final FragmentManager mFragmentManager) 
	{

		super(mFragmentManager);

	}

	
	@Override
	public Fragment getItem(int position) 
	{

	       switch (position) 
	       {
	       
	           case 0:
	        	   
	           	   final FragmentBillTotal mFragmentBillTotal = new FragmentBillTotal();

	               return mFragmentBillTotal;
	            	               
	              
	           case 1:
	        	   
	        	    final FragmentTipPercentage mFragmentTipPercentage = new FragmentTipPercentage();

		            return mFragmentTipPercentage;	   
		            
	           case 2:
	        	   
	        	    final FragmentPeopleNumber mFragmentPeopleNumber = new FragmentPeopleNumber();

		            return mFragmentPeopleNumber;	 
		            
		            
	           case 3:
	        	   
	        	    final FragmentTotals mFragmentTotals = new FragmentTotals();

		            return mFragmentTotals;	 

       }
		return null;
	       
	}
	

	@Override
	public int getCount() 
	{

		return 4;

	}
	
	
    @Override
    public CharSequence getPageTitle(int position)
    {
    	
    	switch(position)
    	{
    	
    		case 0:
    			
    			return ("Tip Hound");
    			
    			
    		case 1:
    			return ("Basic bill");
    			

	    	default:
	    		return "Error";
    	
    	}
    	
    }
    
}
